#!/usr/bin/env python3

def C():
    print("C start....")
    input()
    print("C end....")

def B():
    a = 1
    a += 1
    print("B start....")
    C()
    print("B end....")


def toOct(num):
    if num == 0:
        return
    toOct(num // 8)
    print(num % 8, end='')

def sum(num):
    if num == 0:
        return 0
    return num + sum(num - 1)

#  sum(10)     10 + 45
#  sum(9)      9 + 36
#  sum(8)      8 + 28
#  sum(7)      7 + 21
#  sum(6)      6 + 15
#  sum(5)      5 + 10
#  sum(4)      4 + 6
#  sum(3)      3 + 3
#  sum(2)      2 + 1
#  sum(1)      1 + 0
#  sum(0)      0

def A(a):
    if a == 0:
        return
    print("A start.... a = ", a)
    A(a - 1)
    print("A end.... a = ", a)

#  A(10)
print(sum(1000))

#  toOct(100)
#  print()
